// import store from '../store'

const mutations = {
  setToken: (state, token) => {
    state.token = token
    sessionStorage.setItem('token', token)
  },
  clearToken: (state) => {
    state.token = null
    sessionStorage.clear()
  },
  clearMenu: (state) => {
    state.menus = null
    sessionStorage.clear()
  },
  setUserIdentity: (state, identity) => {
    state.identity = identity
    sessionStorage.setItem('identity', identity)
  },
  setMenu: (state, menus) => {
    state.menus = JSON.parse(JSON.stringify(menus))
    state.isLoadMenu = 1
  },
  setAdminIdentify: (state) => {
    state.adminIdentify = true
  },
  setReturnHistory: (state, returnHistory) => {
    state.returnHistory = returnHistory
  }
}
export default mutations
